﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using ClassProject.Entity;
using Microsoft.ApplicationBlocks.Data;

namespace ClassProject.DAL
{
    class InformationDAL:ADONET
    {
        InformationEn infoEntity = new InformationEn();

        public InformationDAL()
        {

        }


        #region Insert data table Information
        public int Insert()
        {
            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Insert_Information", infoEntity.CategoryID, infoEntity.Title, infoEntity.Url, infoEntity.Content, infoEntity.IsContinued);
            return i;
        }
        #endregion

        #region Update data table Information
        public int Update()
        {

            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Update_Information", infoEntity.CategoryID, infoEntity.Title, infoEntity.Url, infoEntity.Content, infoEntity.InfoID);
            return i;
        }
        #endregion

        #region Delete data table Information
        public int Delete()
        {
            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Delete_Information", infoEntity.InfoID);
            return i;
        }
        #endregion
    }
}
